package com.technology.enumeration;

import com.technology.enumeration.refactor.Lighter;

public class Peshehod extends Object implements Signable {

	private Sfetovor info = new Sfetovor(Signable.RED);
		
	public void stop(){
		System.out.println("stop!");
	}
	
	public void waitForSign(){
		System.out.println("waitForSign!");
	}
	
	public void walk(){
		System.out.println("walk!");
	}
	
	public void go(){
		if (info.getColor() == RED){
			stop();
		}
		else if (info.getColor() == YELLOW){
			waitForSign();
		}
		else if (info.getColor() == GREEN){
			walk();
		}
	}
	
	public void goEnum(Lighter sf){
		switch(sf.getColor()){
			case RED : stop(); break;
			case YELLOW : waitForSign(); break;
			case GREEN : 
			default : walk(); break;
		}
		
	}
	
	public static void main(String[] args) {
		Peshehod p = new Peshehod();
		p.go();
	}
	
}
